@echo off
set SCRIPT_DIR=%~dp0
set CURR_PATH=%cd%

echo -----------------------------------------------------
echo ---        Show -- User Param Config              ---

set CPPCHECK_PATH=D:\AZ_Folder\HQ_Tools\cpp_check\cppcheck-windows\cppcheck.exe
echo CPPCHECK_PATH=%CPPCHECK_PATH%

set PROJECT_DIR=D:\OS_DIR\Downloads\bug_8367\bu_code\mpu
echo PROJECT_DIR=%PROJECT_DIR%

echo -----------------------------------------------------
echo Running Cppcheck
echo -----------------------------------------------------


set XML_FILE_PATH=%CURR_PATH%\cppcheck_report.xml

"%CPPCHECK_PATH%" -v --enable=all --inconclusive --xml-version=2 ^
	-ID:\OS_DIR\Downloads\bug_8367\bu_code\mpu ^
	"%PROJECT_DIR%" 2> "%XML_FILE_PATH%"

echo "Cppcheck analysis completed. XML report generated at %XML_FILE_PATH%"


set PY_GEN_REPORT_WORD=%SCRIPT_DIR%\cppcheck_report_gen.py
set DOCX_REPORT_PATH=%CURR_PATH%\cppcheck_report.docx

echo Generate cppcheck_report.docx
python %PY_GEN_REPORT_WORD% %XML_FILE_PATH% %DOCX_REPORT_PATH%

echo -----------------------------------------------------
echo Over Cppcheck, Generate report: %DOCX_REPORT_PATH%
echo -----------------------------------------------------

pause
